package com.fqgj.sentry.policy.engine.eval.triple;


import com.fqgj.base.services.redis.RedisClient;
import com.fqgj.log.factory.LogFactory;
import com.fqgj.log.interfaces.Log;

public class TripleServiceData {

    public static final Log log = LogFactory.getLog(TripleServiceData.class);

    private static TripleServiceRepo tripleServiceRepo = null;

    /**
     * 缓存失效时间(秒)
     */
    private static final int expireSeconds = 1800;

    /**
     * 缓存key生成规则
     */
    public static final String keyFormat = "{policySetFlowNo}_{apiName}";

    /**
     * 非注解方式得到tripleServiceRepo
     *
     * @return
     */
    public static TripleServiceRepo getTripleServiceRepo() {
        if (tripleServiceRepo == null) {
            tripleServiceRepo = SpringContextUtil.getBean("tripleServiceRepo", TripleServiceRepo.class);
        }
        return tripleServiceRepo;
    }

    /**
     * redisClient
     *
     * @return
     */
    public static RedisClient getRedisClient() {
        return getTripleServiceRepo().getRedisClient();
    }

}
